class Collection < ActiveRecord::Base
  has_many :root_sections, :class_name=>'Section', :table_name=>'sections',
    :conditions=>'parent_id is null', :order=>'id, section_no'
  has_many :sections

  def search(query, options={})
    Document.search("(#{query}) && (collection_id:#{self.id})", options)
  end
end

